package com.faithbj.controller.compareverify;

import com.faithbj.common.configuration.Pager;
import com.faithbj.common.web.controller.BaseController;
import com.faithbj.process.ProcessApplicationService;
import com.faithbj.process.State;
import com.faithbj.process.TaskModel;
import com.faithbj.service.CheckTotalService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * 对比审核
 * @author yfxue
 *
 */
@Controller
@RequestMapping("/compareverify")
public class CompareVerifyController extends BaseController {

	private static final long serialVersionUID = 5094668294376777490L;
	private final Logger logger = LoggerFactory.getLogger(getClass());

	@Resource
	private CheckTotalService checkTotalService;
	
    @Resource
    private ProcessApplicationService processApplicationService;
	
	/**
	 * 街镇核实待办列表,会从小熊哪里发一个
	 * @param pager
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/index")
	public String list(Pager pager,ModelMap map) {
//		//	List<CheckTotal> list=jbpmService.pupu(State.FIRST_CHECK)
//		pager = checkTotalService.getCheckTotalListForApplyInfo(pager);
//		map.put("pager", pager);
//		return "/countyVerify/index";
		List<TaskModel> tasks = processApplicationService
				.listAvailableTasksWithContentByUserAndState(State.FIRST_CHECK_MODIFICATION,
						pager.getFirstResult(), pager.getPageSize());
		pager.setResult(tasks);
		pager.setTotalCount(processApplicationService.countAvailableTasksByUserAndState(State.FIRST_CHECK_MODIFICATION));
		map.put("pager", pager);
		return "/infoInput/index";
	}	

}
